class Student(object):
    # name = 'jzq'  # 类属性
    slots__ = ('city', 'score')  # 限制能添加的属性 子类实例允许定义的属性就是自身的__slots__加上父类的__slots__

    def __init__(self, name, score):
        self._name = name
        self._score = score

    def to_string(self):
        print('name: %s, score: %s' % (self.name, self.score))

    # score可读写
    @property
    def score(self):
        return self._score

    @score.setter
    def score(self, value):
        self._score = value

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, value):
        self._name = value
